It is possible to create a server-side session using javascript for any server-side programming language like PHP, C#, Python etc. by just calling server side function using ajax calls as shown below.
To do that, first create a server side application file and write the session variables which you want to set, then in client side javascript just pass the data which you need to set as a session to the server side application function using Ajax call as shown in below examples